home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Games / SpriteFight 2002 v2.0a1 / SpriteLayer.h < prev    next >
Encoding:
Text File  |  1994-04-25  |  2.7 KB  |  106 lines  |  [TEXT/KAHL]

  1. ///--------------------------------------------------------------------------------------
  2. //    SpriteLayer.h
  3. //
  4. //    Created:    Tuesday, October 27, 1992 at 10:10:06 PM
  5. //    By:        Tony Myles
  6. //
  7. //    Copyright: © 1991-94 Tony Myles, All rights reserved worldwide
  8. //
  9. //    Description:    constants, structures, and prototypes for sprite layers
  10. ///--------------------------------------------------------------------------------------
  11.  
  12.  
  13. #ifndef __SPRITELAYER__
  14. #define __SPRITELAYER__
  15.  
  16. #ifndef __SWCOMMON__
  17. #include "SWCommonHeaders.h"
  18. #endif
  19.  
  20. #ifndef __SPRITE__
  21. #include "Sprite.h"
  22. #endif
  23.  
  24. extern RgnHandle gSWWorkRgn;
  25.  
  26.  
  27. ///--------------------------------------------------------------------------------------
  28. //    sprite layer type definitions
  29. ///--------------------------------------------------------------------------------------
  30.  
  31. typedef struct SpriteLayerRec SpriteLayerRec;
  32. typedef SpriteLayerRec *SpriteLayerPtr, **SpriteLayerHdl;
  33.  
  34.  
  35. ///--------------------------------------------------------------------------------------
  36. //    sprite layer data structure
  37. ///--------------------------------------------------------------------------------------
  38.  
  39. struct SpriteLayerRec
  40. {
  41.     SpriteLayerPtr nextSpriteLayerP;    // next sprite layer
  42.     SpriteLayerPtr prevSpriteLayerP;    // previous sprite layer
  43.  
  44.     SpritePtr headSpriteP;                // head of sprite linked list
  45.     SpritePtr tailSpriteP;                // tail of sprite linked list
  46.  
  47.     long userData;                        // reserved for user
  48. };
  49.  
  50.  
  51. ///--------------------------------------------------------------------------------------
  52. //    sprite layer function prototypes
  53. ///--------------------------------------------------------------------------------------
  54.  
  55. #ifdef __cplusplus
  56. extern "C" {
  57. #endif
  58.  
  59. SW_FUNC OSErr SWCreateSpriteLayer(
  60.     SpriteLayerPtr *spriteLayerP);
  61.  
  62. SW_FUNC void SWDisposeSpriteLayer(
  63.     SpriteLayerPtr spriteLayerP);
  64.  
  65. SW_FUNC void SWAddSprite(
  66.     SpriteLayerPtr spriteLayerP,
  67.     SpritePtr newSpriteP);
  68.  
  69. SW_FUNC void SWRemoveSprite(
  70.     SpriteLayerPtr spriteLayerP,
  71.     SpritePtr oldSpriteP);
  72.  
  73. SW_FUNC void SWRemoveAllSpritesFromLayer(
  74.     SpriteLayerPtr srcSpriteLayerP);
  75.  
  76. SW_FUNC void SWSwapSprite(
  77.     SpriteLayerPtr spriteLayerP,
  78.     SpritePtr srcSpriteP,
  79.     SpritePtr dstSpriteP);
  80.  
  81. SW_FUNC SpritePtr SWGetNextSprite(
  82.     SpriteLayerPtr spriteLayerP,
  83.     SpritePtr curSpriteP);
  84.  
  85. SW_FUNC void SWLockSpriteLayer(
  86.     SpriteLayerPtr spriteLayerP);
  87. SW_FUNC void SWUnlockSpriteLayer(
  88.     SpriteLayerPtr spriteLayerP);
  89.  
  90. SW_FUNC void SWMoveSpriteLayer(
  91.     SpriteLayerPtr spriteLayerP);
  92.  
  93. SW_FUNC void SWCollideSpriteLayer(
  94.     SpriteLayerPtr srcSpriteLayerP,
  95.     SpriteLayerPtr dstSpriteLayerP);
  96.  
  97. SW_FUNC SpritePtr SWFindSpriteByPoint(
  98.     SpriteLayerPtr spriteLayerP,
  99.     SpritePtr startSpriteP,
  100.     Point testPoint);
  101.  
  102. #ifdef __cplusplus
  103. };
  104. #endif
  105.  
  106. #endif /* __SPRITELAYER__ */